<?php
namespace Home\Controller;
use \Think\Controller;

class UserReportController extends Controller{

	public function index(){

		dump(I('post.'));

		//$this->display();
		// 链接数据表
		$user = M('user');

	// 举报人
		$uid = I('post.uid');
		//echo $uid;
		// 查询举报人信息
		$data = $user->where("id = $uid")->select();
		// 获取举报人姓名
		$uname = $data[0]['name'];
	// 被举报人
		$rid = I('post.rid');
		// 查询 被举报人信息
		$data1 = $user->where("id = $rid")->select();
		// 获取被举报人姓名
		$rname = $data1[0]['name'];

	// 把信息插入举报数据库
		$report = M('report');
		 dump($uid);
		 dump($uname);
		dump($rid);
		dump($rname);
		$rlist = array();
		$rlist['uid'] = $uid;
		$rlist['uname'] = $uname;
		$rlist['rid'] = $rid;
		$rlist['rname'] = $rname;
		$rlist['display'] = 1;

		$list = $report->add($rlist); 
		//dump($list);

		//$this->assing('',$uid);
		$this->display('Index/UserDetails');
	}
}